package Main.DAO;


import Main.entity.UserAdvice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class UserDAOImp implements UserDAO{
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Override
    public int insert(UserAdvice user) {
        String sql = "insert into useradvice(msg,phoneNum) values(?,?)";
        return this.jdbcTemplate.update(
                sql,
                user.getMsg(),
                user.getPhoneNum()
        );
    }
}
